//
//  DYEmployeeCell.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/18.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYEmployeeCell.h"

@interface DYEmployeeCell ()

@property (nonatomic,strong)UIImageView *headImageView;
@property (nonatomic,strong)UILabel *nameLabel;
@property (nonatomic,strong)UILabel *loginNameLabel;
@property (nonatomic,strong)UILabel *permissionsLabel;


@end


@implementation DYEmployeeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)dy_initUI
{
    [super dy_initUI];
    

    self.sideMargin=BILIWIDTH(10);
    [self xhq_noneSelectionStyle];
    
    self.headImageView = ({
        UIImageView *imageView=[Utils imageViewWithImage:IMG(@"ic_employeelist")];
        imageView;
    });
    
    self.nameLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:14 textColor:[UIColor xhq_aTitle] alignment:0];
        label;
    });
    
    self.loginNameLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:14 textColor:[UIColor xhq_aTitle] alignment:0];
        label;
    });
    
    self.permissionsLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:14 textColor:[UIColor xhq_aTitle] alignment:2];
        label;
    });
    
    [self addSubview:self.headImageView];
    [self addSubview:self.nameLabel];
    [self addSubview:self.loginNameLabel];
    [self addSubview:self.permissionsLabel];
    
    [self.headImageView makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.left.equalTo(BILIWIDTH(30));
    }];
    
    [self.nameLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.headImageView.right).offset(BILIWIDTH(6));
        make.centerY.equalTo(self);
        make.width.equalTo(BILIWIDTH(80));
    }];
    
    [self.loginNameLabel makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self);
    }];
    
    [self.permissionsLabel makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(BILIWIDTH(-40));
        make.centerY.equalTo(self);
        make.width.equalTo(BILIWIDTH(80));
    }];
    
    self.nameLabel.text=@"张三丰";
    self.loginNameLabel.text=@"18219149052";
    self.permissionsLabel.text=@"营业员";
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
